import cs543.library.rmi.RmiServerInterface;
import cs543.library.rmi.RmiServerRegistry;
import org.json.JSONArray;

public class LocalEcho extends RmiServerInterface {
@Override
public void register () {
new RmiServerRegistry ().register ("Echo", this);
}
@Override
public JSONArray call (String method, JSONArray args) {
Echo obj = new Echo ();
if (method.equals ("getEcho")) {
try {
String ret = obj.getEcho ();
JSONArray arr = new JSONArray ();
arr.put (ret);
return arr;
} catch (Exception e) {}
}
return null;
}
}